package com.rc.evcharger.service.discount;

import com.rc.evcharger.common.base.BaseService;
import com.rc.evcharger.mapper.discount.TenantDiscountPolicyMapper;
import com.rc.evcharger.model.discount.TenantDiscountPolicy;
import com.rc.evcharger.model.discount.TenantDiscountPolicyExample;
import com.rc.evcharger.model.hlht.HlhtOrderInfo;
import com.rc.evcharger.model.order.OrderInfo;
import com.rc.evcharger.vo.cost.UserLevelPriceResult;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by sven on 2019/09/23.
 */
public interface TenantDiscountPolicyService extends BaseService<Long, TenantDiscountPolicy, TenantDiscountPolicyExample, TenantDiscountPolicyMapper> {

    TenantDiscountPolicy selectValidDPolicy(Long discountPolicyId, Date date, String discountType);

    TenantDiscountPolicy selectByMemberIdAndEsId(Long memberId, Long stationId, BigDecimal serviceAmount);

    TenantDiscountPolicy selectPersonalByMemberIdAndEsId(Long memberId, Long stationId, BigDecimal serviceAmount);

    UserLevelPriceResult selectBestByMemberIdAndEsId(OrderInfo orderInfo, String personalType);

    UserLevelPriceResult selectBestBusinessByMemberIdAndEsId(OrderInfo orderInfo, String personalType);

    /**
     * 查询该站点优惠方案是否包含全部会员
     */
    TenantDiscountPolicy selectTotalMember(Long elecStationId, Date date, String discountType);

    BigDecimal countActivityDiscountAmountByPolicy(Long discountPolicyId, Long orderId, BigDecimal totalMoney);

    UserLevelPriceResult countAppointDiscountAmountByPolicy(Long discountPolicyId, Long orderId, BigDecimal totalMoney);

    UserLevelPriceResult compareTicketDisAmount(UserLevelPriceResult userLevelPriceResult0, UserLevelPriceResult UserLevelPriceResult1);

    /**
     * 查询互联互通折扣值
     */
    UserLevelPriceResult selectHlhtValidDPolicyByEsId(OrderInfo orderInfo);

    /**
     * 查询专享优惠折扣值
     */
    UserLevelPriceResult selectAppointByEsId(HlhtOrderInfo hlhtOrderInfo);

    /**
     * 查询互联互通折扣值
     */
    UserLevelPriceResult selectHlhtValidDPolicyByEsId(HlhtOrderInfo hlhtOrderInfo);


}
